package one.SnackGame;

import java.awt.*;
import java.util.Random;

public class SnackFood extends GameObj{
    //随机函数
    Random random = new Random();

    public SnackFood() {
        super();
    }

    public SnackFood(Image image, int x, int y, GameFrame gf) {
        super(image, x, y, gf);
    }

    //获取食物
    //random.nextInt(20)随机数0-19
    public  SnackFood getFood(){
        return new SnackFood(GameUtility.foodImage, random.nextInt(20)*30,(random.nextInt(19)+1)*30,gf);
    }

    @Override
    public void paintSelf(Graphics g) {
        super.paintSelf(g);
    }
}
